<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/8/29
 * Time: 11:06
 */

class DB
{
    public static function insert($v)
    {
        $dsn = 'mysql:host=localhost;dbname=paypal';
        $user = 'root';
        $password = ')evgvU3qa0Z(';
        $sql = "INSERT INTO paypal(value) VALUES("."'$v'".")";
        $dbh = new PDO($dsn, $user, $password);
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        $stmt = $dbh->prepare($sql);
        $stmt->execute();
        return true;
    }
}